﻿using System;
using System.Linq.Expressions;
using Domain.Core.Specification;
using Domain.MainModule.Entities;

namespace Domain.MainModule.GroupBranchCurrencies
{
    public class GroupBranchCurrencyIdSpecification : Specification<GroupBranchCurrency>
    {
        #region public properties

        public Guid GroupBranchCurrencyId
        {
            get;
            set;
        }

        #endregion

        #region constructor

        public GroupBranchCurrencyIdSpecification(Guid groupBranchCurrencyId)
        {
            this.GroupBranchCurrencyId = groupBranchCurrencyId;
        }

        #endregion

        #region public methods

        public override Expression<Func<GroupBranchCurrency, bool>> SatisfiedBy()
        {
            Specification<GroupBranchCurrency> spec = new TrueSpecification<GroupBranchCurrency>();
            spec &= new DirectSpecification<GroupBranchCurrency>(c => c.GroupBranchCurrencyId == this.GroupBranchCurrencyId);

            return spec.SatisfiedBy();
        }

        #endregion
    }
}
